

from Outputs.LOG import Log

Log = Log()
log = Log.log2()


class sp():
    """
    配置打开的url 和 配置选择的浏览器
    """

    def Url(self,url=None):
        """
        获取网址，url可为空，默认https://www.baidu.com/
        :param url:
        :return: url
        """
        if url == 1:
            url = "https://happened48.wshopon.com"
            log.info("网址选择网店前台")

        elif url == 2:
            url = "https://happened48.wshopon.com/products/ri-yuan-ce-shi-2"
            log.info("商品详情页")

        else:
            url = "https://www.baidu.com"
            log.info("网址为空,默认百度")
        return url


    def BROWSER(self,browser = None):
        """
        获取浏览器，browser可为空。默认Chrome
        :param browser:
        :return:  browser
        """

        if browser == "Chrome":
            browser = "Chrome"
        if browser == "Firefox":
            browser = "Firefox"
        if browser == "IE":
            browser = "IE"
        if browser == "Edge":
            browser = "Edge"
        else:
            browser = "Chrome"
            log.info("浏览器为空，默认谷歌")
        return browser








